<?php
include_once 'userConnector.php';
class DBNavigator extends userConnector {

	protected  $con = null;

	function __construct(){
		//
	}

	public static function getLinks($user_id){
		$con = self::StartUserConnector();
		
		$con->Select('Select * from user_page_explorer where navi = 0 and user_id = '.$user_id.' ORDER BY navi_posi ASC');
		$Navi = $con->fetchobject();
		return $Navi;
	}	
	public static function getNavi($user_id,$select){
		$con = self::StartUserConnector();
		
		$con->Select('Select * from user_page_explorer where navi = 0 and user_id = '.$user_id.' ORDER BY navi_posi ASC');
		$Navis = $con->fetchobject();
		
		foreach ($Navis as $key => $navi){
		    if($navi->url == $select){
		       $Navis[$key]->NaviAktiv = 1;
		    } 
		}
		return $Navis;
	}
}

?>